<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017\10\25 0025
 * Time: 11:54
 */

namespace app\api\model;


class ThirdAPI
{
    public function __construct()
    {

    }


    //身份证查询接口 。
    public function id_card($idno){
        $data = http_build_query([
            'cardno' => $idno,
            'key'=> '6db62872322738888517cdf58b702697'
        ]);
        $url = "http://apis.juhe.cn/idcard/index?".$data ;
        $res =json_decode(curl($url),true) ;
        if($res['resultcode']==200){
            $rdata = $res['result'];
            $final = '' ;
            foreach($rdata as $k =>$v){
                $final =$final.$k.':'.$v .'</br>';
            }
        }else{
            $final = $res['resultcode'] ;
        }
        return $final ;
    }

    /*
     * http请求
     * @url  url地址
     * @data 传递参数
     * @type 请求方法
     * */

}